<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text">
    <script>
        var inputTF = document.querySelector('input');
        //1.监听键盘事件
        document.addEventListener('keyup', function(event) {
            //1.检测用户是否按下s建， 如果按下s建 就把光标定位到搜索框内，我们通过ASCII来判断
            if (event.keyCode === 83) {
                //表示按下键盘的s建
                inputTF.focus();
            }
        })
    </script>
</body>
</html>